var markers = new Array();
var bound = new google.maps.LatLngBounds();

function initMarkers()
{
	markers[0] = new google.maps.Marker({
		position: new google.maps.LatLng(38.916000,-77.234000)
	});
	markers[1] = new google.maps.Marker({
		position: new google.maps.LatLng(38.914000,-77.232000)
	});
	markers[2] = new google.maps.Marker({
		position: new google.maps.LatLng(38.915179,-77.233722)
	});
	
}

function zoomToFit(){
	initMarkers();
	 
	  for(var i in markers)
	  {
	    $('#map_canvas').gmap('addMarker', markers[i]);  
	    bound.extend(markers[i].getPosition());
	  }
	  var map = $("#map_canvas").gmap("get", "map");
	  map.fitBounds(bound);
}

$(function() {
	// Also works with: var yourStartLatLng = '59.3426606750, 18.0736160278';
	var latlng = new google.maps.LatLng(38.915179,-77.233722);
	$('#map_canvas').gmap({
		'center' : latlng,
	});
	
});

$('#searchva').live("pageshow", function() {
	zoomToFit();
	$('#map_canvas').gmap('refresh');
});
$('#searchva').live("pageinit", function() {
	$('#map_canvas').gmap({
		'center' : '38.915179,-77.233722'
	});
});

 